using AI.Graph;
using UnityEngine;

[CreateNodeMenu ("Sub State/Change Material")]
public class ChangeMaterialSubState : SubState {

    [ParameterType (typeof (Renderer))]
    public ExposedParameter rendererParameter;

    public Material material;


    protected override void OnPerform (AIBehaviour aiBehaviour) {
        if (aiBehaviour.TryGetExposedObject (rendererParameter, out Renderer renderer)) {
            renderer.material = material;
        }
    }

}